//
//  CateCollectionViewCell.m
//  悠狸
//
//  Created by dlios on 15-8-29.
//  Copyright (c) 2015年 Dung. All rights reserved.
//

#import "CateCollectionViewCell.h"
#import "CateModel.h"

#import "UIImageView+WebCache.h"

@interface CateCollectionViewCell()

@property (nonatomic, retain)UIImageView *imageV;
@property (nonatomic, retain)UILabel *label;
@end
@implementation CateCollectionViewCell

- (void)dealloc
{
    [_imageV release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self create];
    }
    return self;
}
- (void)create
{
    self.imageV = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width/ 6, 60*OffHeight)] autorelease];
//    _imageV.backgroundColor = [UIColor yellowColor];
    
    [self.contentView addSubview:_imageV];
    
    self.label = [[[UILabel alloc] initWithFrame:CGRectMake(0, 60*OffHeight, [UIScreen mainScreen].bounds.size.width / 6, 25*OffHeight)] autorelease];
    [self.contentView addSubview:_label];
    _label.font = [UIFont systemFontOfSize:15];
    _label.textAlignment = NSTextAlignmentCenter;
   
    
}

- (void)sendModel:(CateModel *)model
{
    [_imageV sd_setImageWithURL:[NSURL URLWithString:model.icon_url] placeholderImage:[UIImage imageNamed:@"000.jpg"]];
    _label.text = model.name;
}

@end
